gdk/popup: Remove the popup-layout-changed signal
authorJonas Ådahl <jadahl@gmail.com>
Thu, 3 Dec 2020 22:20:31 +0000 (23:20 +0100)
committerJonas Ådahl <jadahl@gmail.com>
Mon, 7 Dec 2020 19:37:29 +0000 (20:37 +0100)
It was replaced with GdkSurface::layout.

gdk/gdkpopup.c
gdk/macos/gdkmacossurface.c
gtk/gtkpopover.c

index bcd8c8ed294c4fa7dbe2afd189331af4d8072499..6e45e9f93e389657793b89dc98d24bff8a7a6722 100644 (file)
 
 G_DEFINE_INTERFACE (GdkPopup, gdk_popup, GDK_TYPE_SURFACE)
 
-enum
-{
-  POPUP_LAYOUT_CHANGED,
-
-  N_SIGNALS
-};
-
-static guint signals[N_SIGNALS] = { 0 };
-
 static gboolean
 gdk_popup_default_present (GdkPopup       *popup,
                            int             width,
@@ -101,25 +92,6 @@ gdk_popup_default_init (GdkPopupInterface *iface)
                            P_("Whether to hide on outside clicks"),
                            FALSE,
                            G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS));
-
-  /**
-   * GdkPopup::popup-layout-changed
-   * @popup: the #GdkSurface that was laid out
-   *
-   * Emitted when the layout of a popup surface has changed, e.g. if the popup
-   * layout was reactive and after the parent moved causing the popover to end
-   * up partially off-screen.
-   */
-  signals[POPUP_LAYOUT_CHANGED] =
-    g_signal_new (g_intern_static_string ("popup-layout-changed"),
-                  GDK_TYPE_POPUP,
-                  G_SIGNAL_RUN_FIRST,
-                  0,
-                  NULL,
-                  NULL,
-                  NULL,
-                  G_TYPE_NONE,
-                  0);
 }
 
 /**
index 4f0617e878e96a065768ef3423d632d5d06f4412..705ae1d5ce136404e54ac4a26107d70338e677e5 100644 (file)
@@ -85,7 +85,7 @@ _gdk_macos_surface_reposition_children (GdkMacosSurface *self)
     }
 
   if (GDK_IS_POPUP (self) && self->did_initial_present)
-    g_signal_emit_by_name (self, "popup-layout-changed");
+    gdk_surface_request_layout (GDK_SURFACE (self));
 }
 
 static void
index 7fcfac9b66ee5aed823399f08b3d7bb5791f878d..21e7f2e7168a494994fb21484e55db32bc6954a6 100644 (file)
@@ -766,16 +766,6 @@ surface_event (GdkSurface *surface,
   return TRUE;
 }
 
-static void
-popup_layout_changed (GdkSurface *surface,
-                      GtkWidget  *widget)
-{
-  GtkPopover *popover = GTK_POPOVER (widget);
-  GtkPopoverPrivate *priv = gtk_popover_get_instance_private (popover);
-
-  update_popover_layout (popover, gdk_popup_layout_ref (priv->layout));
-}
-
 static void
 gtk_popover_activate_default (GtkPopover *popover)
 {
@@ -894,7 +884,6 @@ gtk_popover_realize (GtkWidget *widget)
   g_signal_connect_swapped (priv->surface, "notify::mapped", G_CALLBACK (surface_mapped_changed), widget);
   g_signal_connect (priv->surface, "render", G_CALLBACK (surface_render), widget);
   g_signal_connect (priv->surface, "event", G_CALLBACK (surface_event), widget);
-  g_signal_connect (priv->surface, "popup-layout-changed", G_CALLBACK (popup_layout_changed), widget);
 
   GTK_WIDGET_CLASS (gtk_popover_parent_class)->realize (widget);
 
@@ -919,7 +908,6 @@ gtk_popover_unrealize (GtkWidget *widget)
   g_signal_handlers_disconnect_by_func (priv->surface, surface_mapped_changed, widget);
   g_signal_handlers_disconnect_by_func (priv->surface, surface_render, widget);
   g_signal_handlers_disconnect_by_func (priv->surface, surface_event, widget);
-  g_signal_handlers_disconnect_by_func (priv->surface, popup_layout_changed, widget);
   gdk_surface_set_widget (priv->surface, NULL);
   gdk_surface_destroy (priv->surface);
   g_clear_object (&priv->surface);